/**
 * @Author: weipc 755197142@qq.com
 * @Date: 2025-02-18 17:56:50
 * @LastEditors: weipc 755197142@qq.com
 * @LastEditTime: 2025-03-01 01:10:15
 * @FilePath: src/views/login/login.scss
 * @Description: 这是默认设置,可以在设置》工具》File Description中进行配置
 */
@mixin login-bg($deg, $color1, $color2) {
    background: linear-gradient($deg, $color1, $color2);
}

.login-container {
    --bg-dark: theme('colors.bg.darkContainer');
    min-height: 100vh;
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    @apply bg-gray-50 dark:bg-[var(--bg-dark)] transition-colors duration-300;
    display: flex;
    align-items: center;
    justify-content: center;

    @media (max-width: 640px) {
        padding: 1rem;
    }

    @media (max-width: 380px) {
        padding: 0;
    }
}

.login-card {
    background: var(--ant-color-primary-bg);
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    @apply shadow-slate-100 dark:shadow-slate-500 dark:bg-bg-darkContainer dark:border-border-dark;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    position: relative;
    display: flex;
    overflow: hidden;
    transition: all 0.3s ease;

    /* Add a subtle shadow to distinguish it from container */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);

    &:hover {
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05), 0 8px 16px rgba(0, 0, 0, 0.06);
    }

    @media (max-width: 640px) {
        border-radius: 16px;
        padding: 1.5rem;
    }

    @media (max-width: 380px) {
        border-radius: 0;
        padding: 1rem;
    }
}

.login-card:hover {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05), 0 8px 16px rgba(0, 0, 0, 0.06);
}

.login-left {
    flex: 1.2;
    padding: 3rem;
    @include login-bg(135deg, var(--ant-color-primary-bg) 0%, var(--ant-color-primary-border) 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    &::after {
        content: '';
        position: absolute;
        right: 0;
        top: 10%;
        height: 80%;
        width: 1px;
        background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.05), transparent);
    }

    @media (max-width: 768px) {
        display: none;
    }
}

.illustration {
    max-width: 100%;
    height: auto;
    will-change: transform;
    backface-visibility: hidden;
}

.login-right {
    flex: 0.8;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;

    @media (max-width: 768px) {
        flex: 1;
        padding: 2rem;
    }

    @media (max-width: 380px) {
        padding: 1.5rem;
    }
}

.content-wrapper {
    max-width: 380px;
    margin: 0 auto;
    width: 100%;

    @media (max-width: 768px) {
        max-width: 100%;
    }
}

.login-header {
    margin-bottom: 2.5rem;
    text-align: left;
}

.login-header h1 {
    font-size: 2.2rem;
    @apply text-text dark:text-text-dark;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    transition: color 0.3s ease;

    @media (max-width: 640px) {
        font-size: 1.8rem;
    }

    @media (max-width: 380px) {
        font-size: 1.6rem;
    }
}

.subtitle {
    @apply text-text-tertiary dark:text-text-darkTertiary;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group :deep(.p-inputtext),
.form-group :deep(.p-password input) {
    width: 100%;
    @apply bg-gray-50 dark:bg-bg-darkContainer border-border dark:border-border-dark text-text dark:text-text-dark;
    border-radius: 12px;
    font-size: 0.95rem;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    will-change: border-color, box-shadow, background-color;
    transition: all 0.3s ease;

    &:hover {
        border-color: #94a3b8;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    &:focus {
        border-color: #6366f1;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 2px 4px rgba(0, 0, 0, 0.02);
    }
}

.p-input-icon-left i {
    left: 0.75rem;
    color: #94a3b8;
}

.remember-me label {
    color: #64748b;
    font-size: 0.9rem;
}

:deep(.p-button) {
    background: #6366f1;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    will-change: transform, box-shadow, background-color;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1),
    background-color 0.3s ease;
    backface-visibility: hidden;
    transform: translateZ(0);

    &:hover {
        background: #4f46e5;
        transform: translateY(-1px) translateZ(0);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    }

    &:active {
        transition-duration: 0.1s;
        transform: translateY(0) translateZ(0);
    }
}


@media (max-width: 1024px) {
    .login-left {
        display: none;
    }

    .login-right {
        flex: 1;
        padding: 2.5rem;
    }

    .content-wrapper {
        max-width: 400px;
    }
}

@media (max-width: 640px) {
    .login-container {
        padding: 1rem;
    }

    .login-card {
        border-radius: 16px;
    }

    .login-right {
        padding: 2rem;
    }

    .login-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 380px) {
    .login-container {
        padding: 0;
    }

    .login-card {
        border-radius: 0;
    }

    .login-right {
        padding: 1.5rem;
    }
}
